package action;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import basic.PageInfo;
import basic.QuerySet;
import basic.ResultSet;
import basic.SortInfo;
import common.BaseAction;
import common.dict.CommonDict;
import dicts.RealmDict;
import entities.TCs;
import entities.TCsm;
import entities.TMs;
import entities.TSc;
import entities.TSm;
import interfaces.ICsService;
import interfaces.ICsmService;
import interfaces.IMsService;
import interfaces.IScService;
import interfaces.ISmService;
import net.sf.json.JSONObject;
import util.HttpUtil;
import util.LogUtil;
import util.ParameterUtil;
import utils.DateUtil;
import utils.ExcelUtil;
import utils.NumberUtil;
import utils.StringUtil;

public class CsmAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7507534255609348887L;

	private String merNo;
	private String crdNo;
	private String txnNo;

	private ICsmService csmService;
	private TCsm csmBean;
	private List<TCsm> csmList;
	private String csmNo;
	private String csmNos;
	private String csmSign;
	private String csmRef;
	private String csmTxn;
	private String csmType;
	private Double csmAmount;
	private String csmState;
	private Date csmDate;
	private Date csmDateTop;
	private Date csmDateEnd;
	private String csmRemark;

	private ICsService csService;
	private TCs csBean;
	private List<TCs> csList;
	private String csNo;
	private String csNos;
	private String csType;
	private Double csAmount;
	private String csState;
	private Date csDate;
	private Date csDateTop;
	private Date csDateEnd;
	private String csRemark;

	private IScService scService;
	private TSc scBean;
	private List<TSc> scList;
	private String scNo;
	private String scNos;
	private String scType;
	private Double scAmount;
	private String scState;
	private Date scDate;
	private Date scDateTop;
	private Date scDateEnd;
	private String scRemark;

	private IMsService msService;
	private TMs msBean;
	private List<TMs> msList;
	private String msNo;
	private String msNos;
	private String msType;
	private Double msAmount;
	private String msState;
	private Date msDate;
	private Date msDateTop;
	private Date msDateEnd;
	private String msRemark;

	private ISmService smService;
	private TSm smBean;
	private List<TSm> smList;
	private String smNo;
	private String smNos;
	private String smType;
	private Double smAmount;
	private String smState;
	private Date smDate;
	private Date smDateTop;
	private Date smDateEnd;
	private String smRemark;

	// 进入对账
	public String editunity() throws Exception {
		return SUCCESS;
	}

	// 进行批量对账
	public String saveunity() throws Exception {
		JSONObject resultMap = new JSONObject();
		Map<String, String> paramsMap = new HashMap<String, String>();

		if (StringUtil.isEmpty(text)) {
			addActionError("上传列表不能为空");
			return INFO;
		}
		String[] contents = text.split("\r\n");
		if (contents.length == 0) {
			addActionError("上传的数据不符合格式");
			return INFO;
		}
		int step = 0;
		for (int i = 0; i < contents.length; i++) {
			String line = contents[i];
			try {
				String[] data = line.split("\\|");
				paramsMap.put("type", data[0].trim());
				paramsMap.put("bank", data[1].trim());
				paramsMap.put("serial", data[2].trim());
				paramsMap.put("amount", NumberUtil.transfer(data[3].trim()));
			} catch (Exception e) {
				addActionError("第" + (i + 1) + "行数据格式错误");
				continue;
			}

			try {
				resultMap = JSONObject.fromObject(new HttpUtil().post(RealmDict.GATEWAY + "Unity", paramsMap));
			} catch (Exception e) {
				LogUtil.exception("saveunity_json");
				addActionError("第" + (i + 1) + "行网络不通无法获取结果");
				continue;
			}

			if (!resultMap.getString("code").equals("0000")) {
				addActionError("第" + (i + 1) + "行失败,原因[" + resultMap.getString("message") + "]");
				continue;
			}
			addActionError("第" + (i + 1) + "行成功对账");
			step = step + 1;
		}
		addActionError("共成功 " + step + " 条数据");
		return SUCCESS;
	}

	// 进入补单
	public String editbalance() throws Exception {
		return SUCCESS;
	}

	// 进行批量补单
	public String savebalance() throws Exception {
		JSONObject resultMap = new JSONObject();
		Map<String, String> paramsMap = new HashMap<String, String>();

		if (StringUtil.isEmpty(text)) {
			addActionError("上传列表不能为空");
			return INFO;
		}
		String[] contents = text.split("\r\n");
		if (contents.length == 0) {
			addActionError("上传的数据不符合格式");
			return INFO;
		}
		int step = 0;
		for (int i = 0; i < contents.length; i++) {
			String line = contents[i];
			try {
				String[] data = line.split("\\|");
				paramsMap.put("bcNo", data[0].trim());
				paramsMap.put("bcRef", data[1].trim());
			} catch (Exception e) {
				addActionError("第" + (i + 1) + "行数据格式错误");
				continue;
			}

			try {
				resultMap = JSONObject.fromObject(new HttpUtil().post(RealmDict.GATEWAY + "Balance", paramsMap));
			} catch (Exception e) {
				LogUtil.exception("savebalance_json");
				addActionError("第" + (i + 1) + "行网络不通无法获取结果");
				continue;
			}

			if (!resultMap.getString("code").equals("0000")) {
				addActionError("第" + (i + 1) + "行失败,原因[" + resultMap.getString("message") + "]");
				continue;
			}
			addActionError("第" + (i + 1) + "行成功补单");
			step = step + 1;
		}
		addActionError("共成功 " + step + " 条数据");
		return SUCCESS;
	}

	// 进入拒付上传
	public String editrefuse() throws Exception {
		return SUCCESS;
	}

	// 进行批量拒付
	public String saverefuse() throws Exception {
		JSONObject resultMap = new JSONObject();
		Map<String, String> paramsMap = new HashMap<String, String>();

		if (StringUtil.isEmpty(text)) {
			addActionError("上传列表不能为空");
			return INFO;
		}
		String[] contents = text.split("\r\n");
		if (contents.length == 0) {
			addActionError("上传的数据不符合格式");
			return INFO;
		}
		int step = 0;
		for (int i = 0; i < contents.length; i++) {
			String line = contents[i];
			try {
				String[] data = line.split("\\|");
				paramsMap.put("cbMarkup", data[0]);
				paramsMap.put("bcNo", data[1].trim());
				paramsMap.put("cbAmount", NumberUtil.transfer(data[2].trim()));
				paramsMap.put("cbRemark", data[3].trim());

			} catch (Exception e) {
				addActionError("第" + (i + 1) + "行数据格式错误");
				continue;
			}

			try {
				resultMap = JSONObject.fromObject(new HttpUtil().post(RealmDict.GATEWAY + "Refuse", paramsMap));
			} catch (Exception e) {
				LogUtil.exception("saverefuse_json");
				addActionError("第" + (i + 1) + "行网络不通无法获取结果");
				continue;
			}

			if (!resultMap.getString("code").equals("0000")) {
				addActionError("第" + (i + 1) + "行失败,原因[" + resultMap.getString("message") + "]");
				continue;
			}
			addActionError("第" + (i + 1) + "行成功拒付");
			step = step + 1;
		}
		addActionError("共成功 " + step + " 条数据");
		return SUCCESS;
	}

	// 进入冻结上传
	public String editfreeze() throws Exception {
		return SUCCESS;
	}

	// 进行批量冻结
	public String savefreeze() throws Exception {
		JSONObject resultMap = new JSONObject();
		Map<String, String> paramsMap = new HashMap<String, String>();

		if (StringUtil.isEmpty(text)) {
			addActionError("上传列表不能为空");
			return INFO;
		}
		String[] contents = text.split("\r\n");
		if (contents.length == 0) {
			addActionError("上传的数据不符合格式");
			return INFO;
		}
		int step = 0;
		for (int i = 0; i < contents.length; i++) {
			String line = contents[i];
			try {
				String[] data = line.split("\\|");
				paramsMap.put("txnNo", data[0].trim());
				paramsMap.put("txnRemark", data[1].trim());
			} catch (Exception e) {
				addActionError("第" + (i + 1) + "行数据格式错误");
				continue;
			}

			try {
				resultMap = JSONObject.fromObject(new HttpUtil().post(RealmDict.GATEWAY + "Freeze", paramsMap));
			} catch (Exception e) {
				LogUtil.exception("savefreeze_json");
				addActionError("第" + (i + 1) + "行网络不通无法获取结果");
				continue;
			}

			if (!resultMap.getString("code").equals("0000")) {
				addActionError("第" + (i + 1) + "行失败,原因[" + resultMap.getString("message") + "]");
				continue;
			}
			addActionError("第" + (i + 1) + "行成功冻结");
			step = step + 1;
		}
		addActionError("共成功 " + step + " 条数据");
		return SUCCESS;
	}

	// 进入冻结撤销
	public String editthaw() throws Exception {
		return SUCCESS;
	}

	// 进行批量冻结撤销
	public String savethaw() throws Exception {
		JSONObject resultMap = new JSONObject();
		Map<String, String> paramsMap = new HashMap<String, String>();

		if (StringUtil.isEmpty(text)) {
			addActionError("上传列表不能为空");
			return INFO;
		}
		String[] contents = text.split("\r\n");
		if (contents.length == 0) {
			addActionError("上传的数据不符合格式");
			return INFO;
		}
		int step = 0;
		for (int i = 0; i < contents.length; i++) {
			String line = contents[i];
			try {
				String[] data = line.split("\\|");
				paramsMap.put("txnNo", data[0].trim());
			} catch (Exception e) {
				addActionError("第" + (i + 1) + "行数据格式错误");
				continue;
			}

			try {
				resultMap = JSONObject.fromObject(new HttpUtil().post(RealmDict.GATEWAY + "Thaw", paramsMap));
			} catch (Exception e) {
				LogUtil.exception("savebalance_json");
				addActionError("第" + (i + 1) + "行网络不通无法获取结果");
				continue;
			}

			if (!resultMap.getString("code").equals("0000")) {
				addActionError("第" + (i + 1) + "行失败,原因[" + resultMap.getString("message") + "]");
				continue;
			}
			addActionError("第" + (i + 1) + "行成功撤销");
			step = step + 1;
		}
		addActionError("共成功 " + step + " 条数据");
		return SUCCESS;
	}

	public String showcs() throws Exception {
		if (!csService.exist(csNo)) {
			addActionError("数据不存在");
			return INFO;
		} else {
			csBean = csService.fetch(csNo);
			return SUCCESS;
		}
	}

	public String showsc() throws Exception {
		if (!scService.exist(scNo)) {
			addActionError("数据不存在");
			return INFO;
		} else {
			scBean = scService.fetch(scNo);
			return SUCCESS;
		}
	}

	public String showms() throws Exception {
		if (!msService.exist(msNo)) {
			addActionError("数据不存在");
			return INFO;
		} else {
			msBean = msService.fetch(msNo);
			return SUCCESS;
		}
	}

	public String showsm() throws Exception {
		if (!smService.exist(smNo)) {
			addActionError("数据不存在");
			return INFO;
		} else {
			smBean = smService.fetch(smNo);
			return SUCCESS;
		}
	}

	public String listcs() throws Exception {
		QuerySet<Object> querySet = new QuerySet<Object>();

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("csNo", StringUtil.split(csNo));
		paramMap.put("crdNo", crdNo);
		paramMap.put("txnNo", txnNo);
		paramMap.put("csType", csType);
		paramMap.put("csAmount", csAmount);
		paramMap.put("csState", csState);
		paramMap.put("csDate", ParameterUtil.dateCombin(csDateTop, csDateEnd));
		paramMap.put("csRemark", csRemark);

		SortInfo sortInfo = new SortInfo();
		sortInfo.setSortField((StringUtil.isEmpty(sortField)) ? "csDate" : sortField);
		sortInfo.setSortOrder(sortOrder);

		querySet.setPageInfo(new PageInfo(pageIndex, pageSize));
		querySet.setSortInfo(sortInfo);
		querySet.setParamMap(paramMap);

		ResultSet<TCs> resultSet = csService.search(querySet);
		csList = resultSet.getResultList();
		pageInfo = resultSet.getPageInfo();
		return SUCCESS;
	}

	public String listsc() throws Exception {
		QuerySet<Object> querySet = new QuerySet<Object>();

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("scNo", StringUtil.split(scNo));
		paramMap.put("crdNo", crdNo);
		paramMap.put("txnNo", txnNo);
		paramMap.put("scType", scType);
		paramMap.put("scAmount", scAmount);
		paramMap.put("scState", scState);
		paramMap.put("scDate", ParameterUtil.dateCombin(scDateTop, scDateEnd));
		paramMap.put("scRemark", scRemark);

		SortInfo sortInfo = new SortInfo();
		sortInfo.setSortField((StringUtil.isEmpty(sortField)) ? "scDate" : sortField);
		sortInfo.setSortOrder(sortOrder);

		querySet.setPageInfo(new PageInfo(pageIndex, pageSize));
		querySet.setSortInfo(sortInfo);
		querySet.setParamMap(paramMap);

		ResultSet<TSc> resultSet = scService.search(querySet);
		scList = resultSet.getResultList();
		pageInfo = resultSet.getPageInfo();
		return SUCCESS;
	}

	public String listms() throws Exception {
		QuerySet<Object> querySet = new QuerySet<Object>();

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("msNo", StringUtil.split(msNo));
		paramMap.put("merNo", merNo);
		paramMap.put("txnNo", txnNo);
		paramMap.put("msType", msType);
		paramMap.put("msAmount", msAmount);
		paramMap.put("msState", msState);
		paramMap.put("msDate", ParameterUtil.dateCombin(msDateTop, msDateEnd));
		paramMap.put("msRemark", msRemark);

		SortInfo sortInfo = new SortInfo();
		sortInfo.setSortField((StringUtil.isEmpty(sortField)) ? "msDate" : sortField);
		sortInfo.setSortOrder(sortOrder);

		querySet.setPageInfo(new PageInfo(pageIndex, pageSize));
		querySet.setSortInfo(sortInfo);
		querySet.setParamMap(paramMap);

		ResultSet<TMs> resultSet = msService.search(querySet);
		msList = resultSet.getResultList();
		pageInfo = resultSet.getPageInfo();
		return SUCCESS;
	}

	public String listsm() throws Exception {
		QuerySet<Object> querySet = new QuerySet<Object>();

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("smNo", StringUtil.split(smNo));
		paramMap.put("merNo", merNo);
		paramMap.put("txnNo", txnNo);
		paramMap.put("smType", smType);
		paramMap.put("smAmount", smAmount);
		paramMap.put("smState", smState);
		paramMap.put("smDate", ParameterUtil.dateCombin(smDateTop, smDateEnd));
		paramMap.put("smRemark", smRemark);

		SortInfo sortInfo = new SortInfo();
		sortInfo.setSortField((StringUtil.isEmpty(sortField)) ? "smDate" : sortField);
		sortInfo.setSortOrder(sortOrder);

		querySet.setPageInfo(new PageInfo(pageIndex, pageSize));
		querySet.setSortInfo(sortInfo);
		querySet.setParamMap(paramMap);

		ResultSet<TSm> resultSet = smService.search(querySet);
		smList = resultSet.getResultList();
		pageInfo = resultSet.getPageInfo();
		return SUCCESS;
	}

	public String exportcs() throws Exception {
		QuerySet<Object> querySet = new QuerySet<Object>();

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("csNo", StringUtil.split(csNo));
		paramMap.put("crdNo", crdNo);
		paramMap.put("txnNo", txnNo);
		paramMap.put("csType", csType);
		paramMap.put("csAmount", csAmount);
		paramMap.put("csState", csState);
		paramMap.put("csDate", ParameterUtil.dateCombin(csDateTop, csDateEnd));
		paramMap.put("csRemark", csRemark);

		SortInfo sortInfo = new SortInfo();
		sortInfo.setSortField((StringUtil.isEmpty(sortField)) ? "csDate" : sortField);
		sortInfo.setSortOrder(sortOrder);

		querySet.setPageInfo(new PageInfo(1, CommonDict.EXPORT_LIMIT));
		querySet.setSortInfo(sortInfo);
		querySet.setParamMap(paramMap);

		ResultSet<TCs> resultSet = csService.search(querySet);
		csList = resultSet.getResultList();

		List<String> fieldHead = new ArrayList<String>();
		fieldHead.add("编号");
		fieldHead.add("关联卡号");
		fieldHead.add("关联交易号");
		fieldHead.add("类型");
		fieldHead.add("付款金额");
		fieldHead.add("状态");
		fieldHead.add("发生日期日期");
		fieldHead.add("发生日期时间");
		fieldHead.add("备注");

		List<List<String>> fieldData = new ArrayList<List<String>>();

		for (TCs csBean : csList) {
			List<String> fieldItem = new ArrayList<String>();
			fieldItem.add(csBean.getCsNo());
			fieldItem.add(csBean.getCrdNo());
			fieldItem.add(csBean.getTxnNo());
			fieldItem.add(csBean.getCsType());
			fieldItem.add(csBean.getCsAmount().toString());
			fieldItem.add((csBean.getCsState().equals("0")) ? "无效" : "有效");
			fieldItem.add(DateUtil.format(csBean.getCsDate(), DateUtil.DATE));
			fieldItem.add(DateUtil.format(csBean.getCsDate(), DateUtil.TIME));
			fieldItem.add(csBean.getCsRemark());

			fieldData.add(fieldItem);
		}

		inputStream = ExcelUtil.excel(fieldHead, fieldData);
		return SUCCESS;
	}

	public String exportsc() throws Exception {
		QuerySet<Object> querySet = new QuerySet<Object>();

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("scNo", StringUtil.split(scNo));
		paramMap.put("crdNo", crdNo);
		paramMap.put("txnNo", txnNo);
		paramMap.put("scType", scType);
		paramMap.put("scAmount", scAmount);
		paramMap.put("scState", scState);
		paramMap.put("scDate", ParameterUtil.dateCombin(scDateTop, scDateEnd));
		paramMap.put("scRemark", scRemark);

		SortInfo sortInfo = new SortInfo();
		sortInfo.setSortField((StringUtil.isEmpty(sortField)) ? "scDate" : sortField);
		sortInfo.setSortOrder(sortOrder);

		querySet.setPageInfo(new PageInfo(1, CommonDict.EXPORT_LIMIT));
		querySet.setSortInfo(sortInfo);
		querySet.setParamMap(paramMap);

		ResultSet<TSc> resultSet = scService.search(querySet);
		scList = resultSet.getResultList();

		List<String> fieldHead = new ArrayList<String>();
		fieldHead.add("编号");
		fieldHead.add("关联卡号");
		fieldHead.add("关联交易号");
		fieldHead.add("类型");
		fieldHead.add("付款金额");
		fieldHead.add("状态");
		fieldHead.add("发生日期日期");
		fieldHead.add("发生日期时间");
		fieldHead.add("备注");

		List<List<String>> fieldData = new ArrayList<List<String>>();

		for (TSc scBean : scList) {
			List<String> fieldItem = new ArrayList<String>();
			fieldItem.add(scBean.getScNo());
			fieldItem.add(scBean.getCrdNo());
			fieldItem.add(scBean.getTxnNo());
			fieldItem.add(scBean.getScType());
			fieldItem.add(scBean.getScAmount().toString());
			fieldItem.add((scBean.getScState().equals("0")) ? "无效" : "有效");
			fieldItem.add(DateUtil.format(scBean.getScDate(), DateUtil.DATE));
			fieldItem.add(DateUtil.format(scBean.getScDate(), DateUtil.TIME));
			fieldItem.add(scBean.getScRemark());

			fieldData.add(fieldItem);
		}

		inputStream = ExcelUtil.excel(fieldHead, fieldData);
		return SUCCESS;
	}

	public String exportms() throws Exception {
		QuerySet<Object> querySet = new QuerySet<Object>();

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("msNo", StringUtil.split(msNo));
		paramMap.put("merNo", merNo);
		paramMap.put("txnNo", txnNo);
		paramMap.put("msType", msType);
		paramMap.put("msAmount", msAmount);
		paramMap.put("msState", msState);
		paramMap.put("msDate", ParameterUtil.dateCombin(msDateTop, msDateEnd));
		paramMap.put("msRemark", msRemark);

		SortInfo sortInfo = new SortInfo();
		sortInfo.setSortField((StringUtil.isEmpty(sortField)) ? "msDate" : sortField);
		sortInfo.setSortOrder(sortOrder);

		querySet.setPageInfo(new PageInfo(1, CommonDict.EXPORT_LIMIT));
		querySet.setSortInfo(sortInfo);
		querySet.setParamMap(paramMap);

		ResultSet<TMs> resultSet = msService.search(querySet);
		msList = resultSet.getResultList();

		List<String> fieldHead = new ArrayList<String>();
		fieldHead.add("编号");
		fieldHead.add("关联商户号");
		fieldHead.add("关联交易号");
		fieldHead.add("类型");
		fieldHead.add("付款金额");
		fieldHead.add("状态");
		fieldHead.add("发生日期日期");
		fieldHead.add("发生日期时间");
		fieldHead.add("备注");

		List<List<String>> fieldData = new ArrayList<List<String>>();

		for (TMs msBean : msList) {
			List<String> fieldItem = new ArrayList<String>();
			fieldItem.add(msBean.getMsNo());
			fieldItem.add(msBean.getMerNo());
			fieldItem.add(msBean.getTxnNo());
			fieldItem.add(msBean.getMsType());
			fieldItem.add(msBean.getMsAmount().toString());
			fieldItem.add((msBean.getMsState().equals("0")) ? "无效" : "有效");
			fieldItem.add(DateUtil.format(msBean.getMsDate(), DateUtil.DATE));
			fieldItem.add(DateUtil.format(msBean.getMsDate(), DateUtil.TIME));
			fieldItem.add(msBean.getMsRemark());

			fieldData.add(fieldItem);
		}

		inputStream = ExcelUtil.excel(fieldHead, fieldData);
		return SUCCESS;
	}

	public String exportsm() throws Exception {
		QuerySet<Object> querySet = new QuerySet<Object>();

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("smNo", StringUtil.split(smNo));
		paramMap.put("merNo", merNo);
		paramMap.put("txnNo", txnNo);
		paramMap.put("smType", smType);
		paramMap.put("smAmount", smAmount);
		paramMap.put("smState", smState);
		paramMap.put("smDate", ParameterUtil.dateCombin(smDateTop, smDateEnd));
		paramMap.put("smRemark", smRemark);

		SortInfo sortInfo = new SortInfo();
		sortInfo.setSortField((StringUtil.isEmpty(sortField)) ? "smDate" : sortField);
		sortInfo.setSortOrder(sortOrder);

		querySet.setPageInfo(new PageInfo(1, CommonDict.EXPORT_LIMIT));
		querySet.setSortInfo(sortInfo);
		querySet.setParamMap(paramMap);

		ResultSet<TSm> resultSet = smService.search(querySet);
		smList = resultSet.getResultList();

		List<String> fieldHead = new ArrayList<String>();
		fieldHead.add("编号");
		fieldHead.add("关联商户号");
		fieldHead.add("关联交易号");
		fieldHead.add("类型");
		fieldHead.add("金额");
		fieldHead.add("状态");
		fieldHead.add("发生日期日期");
		fieldHead.add("发生日期时间");
		fieldHead.add("备注");

		List<List<String>> fieldData = new ArrayList<List<String>>();

		for (TSm smBean : smList) {
			List<String> fieldItem = new ArrayList<String>();
			fieldItem.add(smBean.getSmNo());
			fieldItem.add(smBean.getMerNo());
			fieldItem.add(smBean.getTxnNo());
			fieldItem.add(smBean.getSmType());
			fieldItem.add(smBean.getSmAmount().toString());
			fieldItem.add((smBean.getSmState().equals("0")) ? "无效" : "有效");
			fieldItem.add(DateUtil.format(smBean.getSmDate(), DateUtil.DATE));
			fieldItem.add(DateUtil.format(smBean.getSmDate(), DateUtil.TIME));
			fieldItem.add(smBean.getSmRemark());

			fieldData.add(fieldItem);
		}

		inputStream = ExcelUtil.excel(fieldHead, fieldData);
		return SUCCESS;
	}

	////////////////////// ---------------------------//////////////////////////////////////////////////////////////////////////////////////////////////////////////
	////////////////////// ---------------------------//////////////////////////////////////////////////////////////////////////////////////////////////////////////
	////////////////////// ---------------------------//////////////////////////////////////////////////////////////////////////////////////////////////////////////

	public String getMerNo() {
		return merNo;
	}

	public void setMerNo(String merNo) {
		this.merNo = merNo;
	}

	public String getCrdNo() {
		return crdNo;
	}

	public void setCrdNo(String crdNo) {
		this.crdNo = crdNo;
	}

	public String getTxnNo() {
		return txnNo;
	}

	public void setTxnNo(String txnNo) {
		this.txnNo = txnNo;
	}

	public ICsmService getCsmService() {
		return csmService;
	}

	public void setCsmService(ICsmService csmService) {
		this.csmService = csmService;
	}

	public TCsm getCsmBean() {
		return csmBean;
	}

	public void setCsmBean(TCsm csmBean) {
		this.csmBean = csmBean;
	}

	public List<TCsm> getCsmList() {
		return csmList;
	}

	public void setCsmList(List<TCsm> csmList) {
		this.csmList = csmList;
	}

	public String getCsmNo() {
		return csmNo;
	}

	public void setCsmNo(String csmNo) {
		this.csmNo = csmNo;
	}

	public String getCsmNos() {
		return csmNos;
	}

	public void setCsmNos(String csmNos) {
		this.csmNos = csmNos;
	}

	public String getCsmSign() {
		return csmSign;
	}

	public void setCsmSign(String csmSign) {
		this.csmSign = csmSign;
	}

	public String getCsmRef() {
		return csmRef;
	}

	public void setCsmRef(String csmRef) {
		this.csmRef = csmRef;
	}

	public String getCsmTxn() {
		return csmTxn;
	}

	public void setCsmTxn(String csmTxn) {
		this.csmTxn = csmTxn;
	}

	public String getCsmType() {
		return csmType;
	}

	public void setCsmType(String csmType) {
		this.csmType = csmType;
	}

	public Double getCsmAmount() {
		return csmAmount;
	}

	public void setCsmAmount(Double csmAmount) {
		this.csmAmount = csmAmount;
	}

	public String getCsmState() {
		return csmState;
	}

	public void setCsmState(String csmState) {
		this.csmState = csmState;
	}

	public Date getCsmDate() {
		return csmDate;
	}

	public void setCsmDate(Date csmDate) {
		this.csmDate = csmDate;
	}

	public Date getCsmDateTop() {
		return csmDateTop;
	}

	public void setCsmDateTop(Date csmDateTop) {
		this.csmDateTop = csmDateTop;
	}

	public Date getCsmDateEnd() {
		return csmDateEnd;
	}

	public void setCsmDateEnd(Date csmDateEnd) {
		this.csmDateEnd = csmDateEnd;
	}

	public String getCsmRemark() {
		return csmRemark;
	}

	public void setCsmRemark(String csmRemark) {
		this.csmRemark = csmRemark;
	}

	public ICsService getCsService() {
		return csService;
	}

	public void setCsService(ICsService csService) {
		this.csService = csService;
	}

	public TCs getCsBean() {
		return csBean;
	}

	public void setCsBean(TCs csBean) {
		this.csBean = csBean;
	}

	public List<TCs> getCsList() {
		return csList;
	}

	public void setCsList(List<TCs> csList) {
		this.csList = csList;
	}

	public String getCsNo() {
		return csNo;
	}

	public void setCsNo(String csNo) {
		this.csNo = csNo;
	}

	public String getCsNos() {
		return csNos;
	}

	public void setCsNos(String csNos) {
		this.csNos = csNos;
	}

	public String getCsType() {
		return csType;
	}

	public void setCsType(String csType) {
		this.csType = csType;
	}

	public Double getCsAmount() {
		return csAmount;
	}

	public void setCsAmount(Double csAmount) {
		this.csAmount = csAmount;
	}

	public String getCsState() {
		return csState;
	}

	public void setCsState(String csState) {
		this.csState = csState;
	}

	public Date getCsDate() {
		return csDate;
	}

	public void setCsDate(Date csDate) {
		this.csDate = csDate;
	}

	public Date getCsDateTop() {
		return csDateTop;
	}

	public void setCsDateTop(Date csDateTop) {
		this.csDateTop = csDateTop;
	}

	public Date getCsDateEnd() {
		return csDateEnd;
	}

	public void setCsDateEnd(Date csDateEnd) {
		this.csDateEnd = csDateEnd;
	}

	public String getCsRemark() {
		return csRemark;
	}

	public void setCsRemark(String csRemark) {
		this.csRemark = csRemark;
	}

	public IScService getScService() {
		return scService;
	}

	public void setScService(IScService scService) {
		this.scService = scService;
	}

	public TSc getScBean() {
		return scBean;
	}

	public void setScBean(TSc scBean) {
		this.scBean = scBean;
	}

	public List<TSc> getScList() {
		return scList;
	}

	public void setScList(List<TSc> scList) {
		this.scList = scList;
	}

	public String getScNo() {
		return scNo;
	}

	public void setScNo(String scNo) {
		this.scNo = scNo;
	}

	public String getScNos() {
		return scNos;
	}

	public void setScNos(String scNos) {
		this.scNos = scNos;
	}

	public String getScType() {
		return scType;
	}

	public void setScType(String scType) {
		this.scType = scType;
	}

	public Double getScAmount() {
		return scAmount;
	}

	public void setScAmount(Double scAmount) {
		this.scAmount = scAmount;
	}

	public String getScState() {
		return scState;
	}

	public void setScState(String scState) {
		this.scState = scState;
	}

	public Date getScDate() {
		return scDate;
	}

	public void setScDate(Date scDate) {
		this.scDate = scDate;
	}

	public Date getScDateTop() {
		return scDateTop;
	}

	public void setScDateTop(Date scDateTop) {
		this.scDateTop = scDateTop;
	}

	public Date getScDateEnd() {
		return scDateEnd;
	}

	public void setScDateEnd(Date scDateEnd) {
		this.scDateEnd = scDateEnd;
	}

	public String getScRemark() {
		return scRemark;
	}

	public void setScRemark(String scRemark) {
		this.scRemark = scRemark;
	}

	public IMsService getMsService() {
		return msService;
	}

	public void setMsService(IMsService msService) {
		this.msService = msService;
	}

	public TMs getMsBean() {
		return msBean;
	}

	public void setMsBean(TMs msBean) {
		this.msBean = msBean;
	}

	public List<TMs> getMsList() {
		return msList;
	}

	public void setMsList(List<TMs> msList) {
		this.msList = msList;
	}

	public String getMsNo() {
		return msNo;
	}

	public void setMsNo(String msNo) {
		this.msNo = msNo;
	}

	public String getMsNos() {
		return msNos;
	}

	public void setMsNos(String msNos) {
		this.msNos = msNos;
	}

	public String getMsType() {
		return msType;
	}

	public void setMsType(String msType) {
		this.msType = msType;
	}

	public Double getMsAmount() {
		return msAmount;
	}

	public void setMsAmount(Double msAmount) {
		this.msAmount = msAmount;
	}

	public String getMsState() {
		return msState;
	}

	public void setMsState(String msState) {
		this.msState = msState;
	}

	public Date getMsDate() {
		return msDate;
	}

	public void setMsDate(Date msDate) {
		this.msDate = msDate;
	}

	public Date getMsDateTop() {
		return msDateTop;
	}

	public void setMsDateTop(Date msDateTop) {
		this.msDateTop = msDateTop;
	}

	public Date getMsDateEnd() {
		return msDateEnd;
	}

	public void setMsDateEnd(Date msDateEnd) {
		this.msDateEnd = msDateEnd;
	}

	public String getMsRemark() {
		return msRemark;
	}

	public void setMsRemark(String msRemark) {
		this.msRemark = msRemark;
	}

	public ISmService getSmService() {
		return smService;
	}

	public void setSmService(ISmService smService) {
		this.smService = smService;
	}

	public TSm getSmBean() {
		return smBean;
	}

	public void setSmBean(TSm smBean) {
		this.smBean = smBean;
	}

	public List<TSm> getSmList() {
		return smList;
	}

	public void setSmList(List<TSm> smList) {
		this.smList = smList;
	}

	public String getSmNo() {
		return smNo;
	}

	public void setSmNo(String smNo) {
		this.smNo = smNo;
	}

	public String getSmNos() {
		return smNos;
	}

	public void setSmNos(String smNos) {
		this.smNos = smNos;
	}

	public String getSmType() {
		return smType;
	}

	public void setSmType(String smType) {
		this.smType = smType;
	}

	public Double getSmAmount() {
		return smAmount;
	}

	public void setSmAmount(Double smAmount) {
		this.smAmount = smAmount;
	}

	public String getSmState() {
		return smState;
	}

	public void setSmState(String smState) {
		this.smState = smState;
	}

	public Date getSmDate() {
		return smDate;
	}

	public void setSmDate(Date smDate) {
		this.smDate = smDate;
	}

	public Date getSmDateTop() {
		return smDateTop;
	}

	public void setSmDateTop(Date smDateTop) {
		this.smDateTop = smDateTop;
	}

	public Date getSmDateEnd() {
		return smDateEnd;
	}

	public void setSmDateEnd(Date smDateEnd) {
		this.smDateEnd = smDateEnd;
	}

	public String getSmRemark() {
		return smRemark;
	}

	public void setSmRemark(String smRemark) {
		this.smRemark = smRemark;
	}

}
